package com.you.concurrent.juc.condition;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;

public class ConditionSignalDemo {

    Lock lock;

    Condition condition;

    ConditionSignalDemo(Lock lock, Condition condition) {
        this.lock = lock;
        this.condition = condition;
    }

    public void conditionSignalMethod() {
        try {
            System.out.println("--------condition signal start-------");
            lock.lock();
            condition.signalAll();
            System.out.println("--------condition signal end-------");
        } finally {
            lock.unlock();
        }
    }
}
